import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    redirect:'/login',
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue'),
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('../views/Main.vue'),
    children: [
      {
        path: '/apple',
        name: 'Apple',
        component: () => import('../views/mobile/Apple.vue')
      },
      {
        path: '/samsung',
        name: 'Samsung',
        component: () => import('../views/mobile/Samsung.vue')
      },
      {
        path: '/huawei',
        name: 'Huawei',
        component: () => import('../views/mobile/Huawei.vue')
      },
      {
        path: '/xiaomi',
        name: 'Xiaomi',
        component: () => import('../views/mobile/Xiaomi.vue')
      },
      {
        path: '/mobilesetting',
        name: 'MobileSetting',
        component: () => import('../views/setting/MobileSetting.vue')
      },
      {
        path: '/newssetting',
        name: 'NewsSetting',
        component: () => import('../views/setting/NewsSetting.vue')
      },
    ]
  },
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
});

export default router;
